
package com.trydofor.id.exec;

import com.trydofor.id.doer.shell.ArgHelp;
import com.trydofor.id.doer.shell.Command;

/**
 * @author : Shi Rongjiu (www.trydofor.com)
 */
public final class ShellCmd {
    
    private ShellCmd() {
    }
    
    /**
     * register a command
     * 
     * @return the command
     */
    public static Command registerCommand() {
        Command cmd = new Command("register", "register the command");
        
        ArgHelp argName = new ArgHelp("name");
        argName.setManual("the unique name of command,((scope/)*name)");
        argName.setRequired(true);
        cmd.addArgument(argName);
        
        ArgHelp argCmdx = new ArgHelp("comand");
        argCmdx.setManual("the command instance name");
        argCmdx.setRequired(true);
        cmd.addArgument(argCmdx);
        
        ArgHelp argExex = new ArgHelp("executer");
        argExex.setManual("the executer instance name");
        argExex.setRequired(true);
        cmd.addArgument(argExex);
        
        return cmd;
    }
    
    /**
     * unregister a command
     * 
     * @return the command
     */
    public static Command unregisterCommand() {
        Command cmd = new Command("unregister", "unregister the command");
        
        ArgHelp argName = new ArgHelp("name");
        argName.setManual("the unique name of command,((scope/)*name)");
        argName.setRequired(true);
        cmd.addArgument(argName);
        
        return cmd;
    }
}
